import { defineStore } from 'pinia'

import type { IOptState } from './type'
import { isCode } from '@/utils/iscode'

const useHomeStore = defineStore('opt', {
  // state: ():IOptState => ({
  //   fishing:{
  //       servers:{},
  //       props:{},
  //       channel:{},
  //   },
  // }),
  actions: {
    //获取捕鱼服务器
    // async  fetchFishingServerListAction(){
    //   let res = await postFishingGameServerApi()
    //     if(isCode(res)){
    //       this.fishing.servers.list = []
    //       res.result.map((item)=>{
    //         this.fishing.servers.list.push({label:item.serviceName,value:item.serviceId })
    //       })
    //       this.fishing.servers.id = this.fishing.servers.list[0].value
    //       }
    // },

},
  persist: {
    paths: ['']
  }
})

export default useHomeStore
